Optimal. Leaf size=69 \[ \frac{(3 A+2 C) \sin (c+d x)}{3 d}+\frac{B \sin (c+d x) \cos (c+d x)}{2 d}+\frac{B x}{2}+\frac{C \sin (c+d x) \cos ^2(c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0470357, antiderivative size = 69, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.074, Rules used = {3023, 2734} \[ \frac{(3 A+2 C) \sin (c+d x)}{3 d}+\frac{B \sin (c+d x) \cos (c+d x)}{2 d}+\frac{B x}{2}+\frac{C \sin (c+d x) \cos ^2(c+d x)}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3023
Rule 2734
Rubi steps
\begin{align*} \int \cos (c+d x) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx &=\frac{C \cos ^2(c+d x) \sin (c+d x)}{3 d}+\frac{1}{3} \int \cos (c+d x) (3 A+2 C+3 B \cos (c+d x)) \, dx\\ &=\frac{B x}{2}+\frac{(3 A+2 C) \sin (c+d x)}{3 d}+\frac{B \cos (c+d x) \sin (c+d x)}{2 d}+\frac{C \cos ^2(c+d x) \sin (c+d x)}{3 d}\\ \end{align*}
Mathematica [A] time = 0.0937808, size = 53, normalized size = 0.77 \[ \frac{3 (4 A+3 C) \sin (c+d x)+3 B \sin (2 (c+d x))+6 B c+6 B d x+C \sin (3 (c+d x))}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.014, size = 57, normalized size = 0.8 \begin{align*}{\frac{1}{d} \left ({\frac{C \left ( 2+ \left ( \cos \left ( dx+c \right ) \right ) ^{2} \right ) \sin \left ( dx+c \right ) }{3}}+B \left ({\frac{\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{2}}+{\frac{dx}{2}}+{\frac{c}{2}} \right ) +A\sin \left ( dx+c \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.988847, size = 74, normalized size = 1.07 \begin{align*} \frac{3 \,{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B - 4 \,{\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} C + 12 \, A \sin \left (d x + c\right )}{12 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.87581, size = 113, normalized size = 1.64 \begin{align*} \frac{3 \, B d x +{\left (2 \, C \cos \left (d x + c\right )^{2} + 3 \, B \cos \left (d x + c\right ) + 6 \, A + 4 \, C\right )} \sin \left (d x + c\right )}{6 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.60504, size = 107, normalized size = 1.55 \begin{align*} \begin{cases} \frac{A \sin{\left (c + d x \right )}}{d} + \frac{B x \sin ^{2}{\left (c + d x \right )}}{2} + \frac{B x \cos ^{2}{\left (c + d x \right )}}{2} + \frac{B \sin{\left (c + d x \right )} \cos{\left (c + d x \right )}}{2 d} + \frac{2 C \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac{C \sin{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \left (A + B \cos{\left (c \right )} + C \cos ^{2}{\left (c \right )}\right ) \cos{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.19979, size = 72, normalized size = 1.04 \begin{align*} \frac{1}{2} \, B x + \frac{C \sin \left (3 \, d x + 3 \, c\right )}{12 \, d} + \frac{B \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac{{\left (4 \, A + 3 \, C\right )} \sin \left (d x + c\right )}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]